
package org.dromara.system.api.feign;

/**
 * @author: zhou shuai
 * @date: 2024/10/5 17:10
 * @version: v1
 */

import org.dromara.common.core.domain.R;
import org.dromara.system.api.domain.bo.RemoteLogininforBo;
import org.dromara.system.api.domain.bo.RemoteOperLogBo;
import org.dromara.system.api.feign.fallback.SystemLogFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import static org.dromara.common.core.constant.ServerNameConstants.SYSTEM_SERVER_NAME;

@FeignClient(contextId = "system-log-api", name = SYSTEM_SERVER_NAME, fallbackFactory = SystemLogFallBack.class)
public interface SystemLogClient {

    /**
     * 保存系统日志
     *
     * @param remoteOperLogBo 日志实体
     */
    @PostMapping(value = "/api/system/log/save")
    R<Void> saveLog(@RequestBody RemoteOperLogBo remoteOperLogBo);

    /**
     * 保存访问记录
     *
     * @param remoteLogininforBo 访问实体
     */
    @PostMapping(value = "/api/system/log/save/login/infor")
    R<Void> saveLogininfor(@RequestBody RemoteLogininforBo remoteLogininforBo);

}
